package cn.fu.tag;

import java.io.IOException;
import java.io.StringWriter;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.JspFragment;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**   
* @Title: ModifyBodyContent.java 
* @Package cn.fu.tag 
* @Description: 改变标签体内容 
* @author zhangxiaofu   
* @Company www.viewhigh.com
* @date 2016年7月23日 下午11:27:53 
* @version V1.0   
*/
public class ModifyBodyContent extends SimpleTagSupport{
	@Override
	public void doTag() throws JspException, IOException {
		//用于存放标签体内容
		StringWriter stringWrite= new StringWriter();
		//标签缓冲区（因没有办法取到缓冲区内容）
		JspFragment jspFragment = getJspBody();
		//将数区回收，写到输出
		jspFragment.invoke(stringWrite);
		String content = stringWrite.toString();
		content ="www.99fu.cn";
		PageContext pageContext =(PageContext)getJspContext();
		pageContext.getOut().write(content);
	}
}

